﻿using System.Collections.Generic;

namespace Utils
{
    //专门用于layer table
    public class ReceiveStatus
    {
        /// <summary>
        /// 数据状态的字段名称，默认：code
        /// </summary>
        public statuCode code { get; set; }

        /// <summary>
        /// 状态信息的字段名称，默认：msg
        /// </summary>
        public string msg { get; set; }

        /// <summary>
        /// 数据总数的字段名称，默认：count
        /// </summary> 
        public int count { get; set; }

        /// <summary>
        /// 构造函数默认code为成功
        /// </summary>
        public ReceiveStatus()
        {
            code = statuCode.Successful;
        }
    }
    /// <summary>
    /// 返回list数据
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class ReceiveStatus<T> : ReceiveStatus
    {
        public List<T> data { get; set; }
    }

    /// <summary>
    /// 返回code 状态
    /// </summary>
    public enum statuCode
    {
        /// <summary>
        ///     操作成功
        /// </summary>
        Successful = 0,

        /// <summary>
        ///     警告
        /// </summary>
        Warning = 1,

        /// <summary>
        ///     操作引发错误
        /// </summary>
        Error = 2
    }
}
